package com.bb.flow.service.imp.node.UserLoginFlow;

import com.bb.flow.service.imp.node.FlowNodeBase;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.function.Function;

public class ValiadPassword extends FlowNodeBase {

    private static final long serialVersionUID = 8908122942278828282L;

    private transient Function<Integer, Boolean> x = p -> {
        System.out.println("正在比对密码");
        return true;
    };
    private transient ExecutorService executorService = Executors.newCachedThreadPool();

    @Override
    public void execute() {
        //        System.out.println("开始启动密码验证");
        notifyDriver();

        //        executorService.submit(() -> {
        //            x.andThen(p -> {
        //                System.out.println("密码验证结束");
        //                notifyDriver();
        //                return true;
        //            }).compose(p -> {
        //                System.out.println("正在加密密码");
        //                return 100;
        //            }).compose(p -> {
        //                System.out.println("正在读取密码源");
        //                return new Random().nextInt(10000);
        //            }).apply(1);
        //        });
    }
}
